<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.cr.model.Customer"%>
<%@ page import="com.cr.model.Cloth"%>
<%@ page import="com.cr.service.ClothService"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Clothing Rental</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="style/style.css">
	<script type="text/javascript" src="easyui/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="script/main.js"></script>
  </head>
  
  <body>
    <jsp:include page="header.jsp"></jsp:include>
    <div id="content">
    	<div id="search">
    		<p><input id="searcher" type="text"/></p>
    	</div>
    	<div id="clothes">
    		<%
    			ClothService service=new ClothService();
    			String condition="";
    			String id=request.getParameter("id");
    			Cloth cloth=null;
    			if(id!=null && !id.equals(""))
    			{
    				cloth=service.getCloth(Long.parseLong(id));
    			}
    			
    		 %>
    		 <table style="width:90%;">
    		 	<%
    		 		if(cloth!=null)
    		 		{
    		 	 %>
    		 	 	<tr>
    		 	 		<td style="width:30%;text-align:left;"><img src="<%=cloth.getPicture().get(0) %>" class="cloth_img"/></td>
    		 	 		<td style="width:70%;text-align:left;">
    		 	 			<ul>
    		 	 				<li><%=cloth.getName() %></li>
    		 	 				<li><%=cloth.getStyle() %></li>
    		 	 				<li><%=cloth.getMaterial() %></li>
    		 	 				<li>￥<%=cloth.getPrice() %>RMB/Day</li>
    		 	 			</ul>
    		 	 		</td>
    		 	 	</tr>
    		 	 	<tr>
    		 	 		<td colspan="2">
    		 	 			<hr />
    		 	 			<p>Introduce:<%=cloth.getDescription() %></p>
    		 	 			<div>
    		 	 				<p>Pictures:</p>
    		 	 				<%
    		 	 					int i=0;
    		 	 					for(String str:cloth.getPicture())
    		 	 					{
    		 	 						i++;
    		 	 						out.print("<img src='"+str+"' class='des_pic'/>");
    		 	 						if(i%4==0)
    		 	 						{
    		 	 							out.print("<br />");
    		 	 						}
    		 	 					}
    		 	 				 %>
    		 	 			</div>
    		 	 		</td>
    		 	 	</tr>
    		 	 <%
    		 	 	}
    		 	  %>
    		 </table>
    	</div>
    </div>
    <jsp:include page="footer.jsp"></jsp:include>
  </body>
</html>
